/**
 * Copyright &copy; 2012-2017 <a href="https://vivo.com">vivo</a> All rights reserved.
 */
package com.vivo.dealer.service;

import java.util.List;

import com.vivo.dealer.dao.ViAgenterWithLevelDao;
import com.vivo.dealer.entity.ViAgenterWithLevel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.vivo.dealer.entity.ViAgenterTerminal;
import com.vivo.dealer.dao.ViAgenterTerminalDao;

/**
 * 代理经销商信息Service
 * @author jyangye
 * @version 2018-02-12
 */
@Service
@Transactional(readOnly = true)
public class ViAgenterTerminalService extends CrudService<ViAgenterTerminalDao, ViAgenterTerminal> {

    @Autowired
    private ViAgenterTerminalDao viAgenterTerminalDao;

	public ViAgenterTerminal get(String id) {
		return super.get(id);
	}
	
	public List<ViAgenterTerminal> findList(ViAgenterTerminal viAgenterTerminal) {
		return super.findList(viAgenterTerminal);
	}
	
	public Page<ViAgenterTerminal> findPage(Page<ViAgenterTerminal> page, ViAgenterTerminal viAgenterTerminal) {
		return super.findPage(page, viAgenterTerminal);
	}

	public List<ViAgenterTerminal> findListExt() {
	    return viAgenterTerminalDao.findListExt();
    }

	@Transactional(readOnly = false)
    public void insertByBatch(List<ViAgenterTerminal> list, String area) {
	    if (area.equals("ah")) {
	        viAgenterTerminalDao.insertByBatchAh(list);
        } else {
	        viAgenterTerminalDao.insertByBatchJs(list);
        }
    }

	@Transactional(readOnly = false)
    public void deleteAll(ViAgenterTerminal viAgenterTerminal) {
	    viAgenterTerminalDao.deleteAll(viAgenterTerminal);
    }
	
	@Transactional(readOnly = false)
	public void save(ViAgenterTerminal viAgenterTerminal) {
		super.save(viAgenterTerminal);
	}
	
	@Transactional(readOnly = false)
	public void delete(ViAgenterTerminal viAgenterTerminal) {
		super.delete(viAgenterTerminal);
	}
	
}